package demo1;

import java.util.Arrays;

public class 数组拷贝 {
    public static void main(String[] args) {
        int[] arr1 = {1,2,3,4,5};
        int[] arr2 = new int[5];
        for (int i = 0; i < arr2.length; i++) {
            arr2[i] = arr1[i];
        }
        arr2[0] = 10;
        System.out.println(arr1[0]);
        System.out.println(arr2[0]);
        System.out.println(Arrays.toString(arr1));
        System.out.println(Arrays.toString(arr2));
    }
}
